Widget.ready(function() {
	var button = UI.freeFloatButton({
		id: 'cfx',
		innerText: 'CFx ' + Environment.appVersion + '/' + Environment.apiVersion,
		top: '0',
		left: '0'			
	});
	
	var frame =	Cloud.hostedFrame({
		id: 'dashboard',
		url: Environment.APP_URL + 'dashboard/',
		selector: '#cfx',
		placement: 'append',
		wrap: '<div></div>',
		width: '100%',
		height: '300px',
		border: '1px solid black',
		display: 'none' //hidden by default.
	});
	
	button.waitForInit(function() {
		$w(button.selector, true).click(function() {
			$w(button.selector).css('width', '100%');
			frame.show();
		});
		
		$w(button.selector, true).mouseleave(function() {
			frame.hide();
			$w(button.selector).css('width', 'auto');
		});
	});
});